package util.model;

import java.util.Objects;

/**
 * @author yue.cao
 * @since 10-15-2020
 */
public class WordCount {

	public String word;

	public Long count;


	public WordCount() {
	}

	public WordCount(String word, Long count) {
		this.word = word;
		this.count = count;
	}

	public static WordCount of(String word, Long count) {
		return new WordCount(word, count);
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		WordCount wordCount = (WordCount) o;
		return Objects.equals(word, wordCount.word) &&
				Objects.equals(count, wordCount.count);
	}

	@Override
	public int hashCode() {
		return Objects.hash(word, count);
	}

	@Override
	public String toString() {
		return "WordCount{" +
				"word='" + word + '\'' +
				", count=" + count +
				'}';
	}
}
